//
//  TVStatementViewModel.swift
//  StarTimesON
//
//  Created by Toj on 11/15/22.
//  Copyright © 2022 StarTimes. All rights reserved.
//

import UIKit

class TVStatementViewModel: NSObject {
    
    private(set) lazy var months: [TVStatementMonthCellModel] = {
        let date = Date()
        
        let formatter = DateFormatter()
        formatter.dateFormat = "yyyy/MM"
        formatter.locale = Locale(identifier: "en")
        
        var array = [TVStatementMonthCellModel]()
        for i in 0..<30 {
            let date = date.dt_firstDayByAdd(month: -i)
            let monthCellModel = TVStatementMonthCellModel(firstDay: date, formatter: formatter)
            array.append(monthCellModel)
        }
        array.first?.isSelected = true
        return array
    }()
}
